Skip to content

feat(workspace): add sampling to loader diff harness + bit show coverage#10352

Merged
davidfirst merged 1 commit intorefactor/component-loading-v2-take-2from
refactor/component-loader-harness-coverage
May 7, 2026
Merged

feat(workspace): add sampling to loader diff harness + bit show coverage#10352
davidfirst merged 1 commit intorefactor/component-loading-v2-take-2from
refactor/component-loader-harness-coverage

Conversation

@davidfirst
Copy link
Copy Markdown
Member

Builds on #10349. Two small follow-ups to the harness:

1. `BIT_LOADER_DIFF_SAMPLE=N` for big workspaces

On large workspaces (bit7 itself, ~300 components), running both loaders for every call doubles cache footprint and OOMs Node's default 4GB heap. `BIT_LOADER_DIFF_SAMPLE=10` runs the partner only every 10th call. The previously-skipped e2e test (`bit status` on a tagged+modified workspace) now passes with sample rate 50.

Trade-off documented in `SNAPSHOT-CONTRACT.md`: sampling can miss regressions on non-sampled calls. Use the lowest rate the workspace can afford.

2. `bit show` coverage confirmed

The earlier "bit show doesn't trigger the harness" report turned out to be a stale-compile artifact — once the workspace component is recompiled with the latest `workspace.ts`, `bit show comp1` produces a header line and zero diffs. Added an e2e test to pin this.

`bit list` still doesn't trigger the harness, but that's by design: it only reads `consumer.bitMap.bitmapIdsFromCurrentLane` and never loads components. Documented in `SNAPSHOT-CONTRACT.md` under "Command coverage".

Verification

  • All 3 e2e tests in `loader-diff-harness.e2e.ts` now pass (was 1 passing + 1 skipped).
  • 21 contract tests still pass.

Adds BIT_LOADER_DIFF_SAMPLE=N to skip the partner on most calls. Lets the
harness run on workspaces big enough that V1+V1 in parallel would OOM
the default 4GB heap. Adds a bit-show e2e (the previous "bit show isn't
covered" report turned out to be a stale-compile artifact). Documents
actual command coverage in SNAPSHOT-CONTRACT.md.
@davidfirst davidfirst merged commit 6682e50 into refactor/component-loading-v2-take-2 May 7, 2026
10 of 12 checks passed
@davidfirst davidfirst deleted the refactor/component-loader-harness-coverage branch May 7, 2026 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant